package com.esri.core.io;

import com.esri.core.internal.io.handler.n;
import com.esri.core.internal.io.handler.o;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.security.KeyStore;

/* loaded from: classes.dex */
public class UserCredentials implements Serializable {
    private static boolean b = false;
    private static final long serialVersionUID = 5661154003751399898L;
    private o a;

    /* loaded from: classes.dex */
    public enum AuthenticationType {
        NONE,
        TOKEN,
        HTTP,
        CERTIFICATE,
        UNKNOWN
    }

    public UserCredentials() {
        this.a = new o();
    }

    public UserCredentials(UserCredentials userCredentials) {
        this.a = new o(userCredentials.a);
    }

    public UserCredentials getCopy() {
        return new UserCredentials(this);
    }

    public static void setTrustStore(KeyStore keyStore) throws EsriSecurityException {
        setTrustStore(null, null, keyStore);
    }

    public static void setTrustStore(KeyStore keyStore, String str, KeyStore keyStore2) throws EsriSecurityException {
        o.a(keyStore, str, keyStore2);
    }

    public String getDomain() {
        return this.a.b();
    }

    public void setDomain(String str) {
        this.a.a(str);
    }

    public void setUserAccount(String str, String str2) {
        this.a.a(str, str2);
    }

    public void setUserName(String str) {
        this.a.b(str);
    }

    public void setUserToken(String str, String str2) {
        setUserToken(str, -1L, str2);
    }

    public void setUserToken(String str, long j, String str2) {
        this.a.a(str, j, str2);
    }

    public void setTokenServiceUrl(String str) {
        this.a.c(str);
    }

    public String getToken() {
        return this.a.c();
    }

    public long getTokenExpiry() {
        return this.a.d();
    }

    public String getReferer() {
        return this.a.e();
    }

    public String getTokenServiceUrl() {
        return this.a.f();
    }

    public String getUserName() {
        return this.a.g();
    }

    public String getPassword() {
        return this.a.h();
    }

    public boolean isSSLRequired() {
        return this.a.i();
    }

    public void setSSLRequired(boolean z) {
        this.a.a(z);
    }

    public static AuthenticationType getServiceAuthenticationType(String str) {
        return o.d(str);
    }

    public static void clearCachedCredentials(String str) throws EsriSecurityException {
        n.a(str);
    }

    public AuthenticationType getAuthenticationType() {
        return this.a.j();
    }

    public void setAuthenticationType(AuthenticationType authenticationType) {
        this.a.a(authenticationType);
    }

    public boolean isEmpty() {
        return this.a.k();
    }

    public int hashCode() {
        return this.a.hashCode();
    }

    public boolean equals(Object obj) {
        return this.a.equals(obj);
    }

    public String toString() {
        return this.a.toString();
    }

    public static boolean isDefaultReadObject() {
        return b;
    }

    public static void setDefaultReadObject(boolean z) {
        b = z;
    }

    private void writeObject(ObjectOutputStream objectOutputStream) throws IOException {
        objectOutputStream.writeObject(this.a);
    }

    private void readObject(ObjectInputStream objectInputStream) throws ClassNotFoundException, IOException {
        if (b) {
            objectInputStream.defaultReadObject();
        } else {
            this.a = (o) objectInputStream.readObject();
        }
    }
}
